package com.engine.avic.duss.util;

import weaver.hrm.company.DepartmentComInfo;
import weaver.hrm.resource.ResourceComInfo;

/**
 * @Title: ecology-idea
 * @Company: 泛微软件
 * @author: weaver.Dusongsong
 * @version: 1.0
 * @CreateDate: 2022-03-07
 * @Description: ${description}
 * @ModifyLog:
 **/

public class utils {
    public static String getUserName(String ids) {
        String lastnames = "";
        try {
            String[] strs = ids.split( "," );
            ResourceComInfo hrmComInfo = new ResourceComInfo();
            for (String id : strs) {
                String lastname = hrmComInfo.getLastname( id );
                lastnames += "".equals( lastnames ) ? lastname : "," + lastname;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return lastnames;
    }

    public static String getDepartName(String ids) {
        String departnames = "";
        try {
            DepartmentComInfo depComInfo = new DepartmentComInfo();
            String[] strs = ids.split( "," );
            for (String id : strs) {
                String departname = depComInfo.getDepartmentName( id );
                departnames += "".equals( departnames ) ? departname : "," + departname;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return departnames;
    }

    public static String getNumber(int num) {
        String str = "";
        switch (num) {
            case 1:
                str = "进行";
                break;
            case 2:
                str = "准备";
                break;
            default:
                str = "等候";
                break;
        }
        return str;
    }
}
